package com.czk.model.buildermodel.practice;

/**
 * 具体的建造者，决定怎么建和建造顺序
 * @Author:ChenZhangKun
 * @Date: 2020/7/2 23:13
 */
public class CarDirector {
    // 将建造者聚合，通过构造方法方法注入
    private CarBuilder carBuilder;

    public CarDirector(CarBuilder carBuilder) {
        this.carBuilder = carBuilder;
    }
    // 建造车子
    public Car produceCar(){
        carBuilder.stickBrand();
        carBuilder.pickWheel();
        carBuilder.pickShell();
        System.out.println(carBuilder.car);
        return carBuilder.produceCar();
    }
}
